package com.fit.piris.entities.fanpage;

import java.util.LinkedList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;

import com.fit.piris.entities.user.fanpage.UserFanPage;

@Entity
@Table(name = "fan_pages")
public class FanPage {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NonVisual
	@Column(name = "fan_page_id")
	private Long id;
	@Column(name = "name", nullable=false)
	private String name;
	@Column(name = "description", columnDefinition = "TEXT")
	private String description;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.fanPage")
	private List<UserFanPage> userFanPages = new LinkedList<UserFanPage>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<UserFanPage> getUserFanPages() {
		return userFanPages;
	}

	public void setUserFanPages(List<UserFanPage> userFanPages) {
		this.userFanPages = userFanPages;
	}

}
